﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;

using ZFB.Common;
using ZFB.DTO;

namespace ZFB.IServices
{
    public interface IPermissionServices
    {
        /// <summary>
        /// 获取某个权限
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ApiResult> GetByIdAsync(long id);
        /// <summary>
        /// 获取所有权限
        /// </summary>
        /// <returns></returns>
        Task<ApiResult> GetAllAsync();
        /// <summary>
        /// 获取名字为name的权限信息GetByName("UserAdd")
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        Task<ApiResult> GetByNameAsync(string name);
        /// <summary>
        /// 获取角色的全部权限
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        Task<ApiResult> GetByRoleIdAsync(long roleId);
        /// <summary>
        /// 给角色roleld 增加权限项id permlds
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="permIds"></param>
        /// <returns></returns>
        Task<ApiResult> AddPermIdsAsync(long roleId, long[] permIds);
        /// <summary>
        /// 更新角色role的权限项:先删除再添加
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="permIds"></param>
        /// <returns></returns>
        Task<ApiResult> UpdatePermIds(long roleId, long[] permIds);
    }
}
